# 统计长度，使用内置函数len
name = "itheima"
length=len(name)
print(length)

# 不使用len
string1="itheima"
string2="itcast"
string3="python"
count=0
for i in string1:
    count+=1
print(count)

# 自建
def my_lean(data):
    count=0
    for i in data:
        count+=1
        print(count)
my_lean(string1)
my_lean(string2)
my_lean(string3)